package tu.test;

import tu.linjiebiao.biao.ALGraph;
import tu.shortestPath.ShortestPath_Dij;

import java.util.Scanner;

public class Demo_4 {
    public final static int INFINITY = Integer.MAX_VALUE;      //最大值
    public static void main(String[] args) throws Exception {
        Object[] temp ={"成都","重庆","武汉","贵阳","昆明","南昌","北京","长沙","上海","杭州","南京","郑州","西安","兰州"};
        ALGraph alg = new ALGraph(temp);
        Scanner input = new Scanner(System.in);
        System.out.println("请输入始发站：");
        String start1 = input.next();
        int start = -1;
        for (int i = 0; i < temp.length; i++){
            if(temp[i].equals(start1)){
                start = i; 
            }
        }
        System.out.println("请输入终点站：");
        String arr1 = input.next();
        int arr = -1;
        for (int i = 0; i < temp.length; i++) {
            if(temp[i].equals(arr1)){
                arr = i;
            }
        }
        ShortestPath_Dij dij = new ShortestPath_Dij();
        System.out.println("用时最短：");
        int[] shortPath = dij.Dijkstra(alg.jz_time,start,temp,arr,false);
        
        System.out.println("花费最少；");
        int[] shortPath1 = dij.Dijkstra(alg.jz_money,start,temp,arr,false);

        System.out.println("中转最少；");
        int[] shortPath2 = dij.Dijkstra(alg.jz_time,start,temp,arr,true);
        
        // for(int i = 0; i < shortPath.length;i++){
        //     System.out.println("从" + start + "出发到" + i + "的最短距离为："+ shortPath[i]);
        // }
    }
}
